#ifndef LOG_H_
#define LOG_H_	

	#define def_IMU_perPage 4
	#define def_GPS_perPage 4
	#define def_LOG_PAGE_LEN 128

class GPSRecord {
	public:
		long lat;
		long lon;
		int DOP;
};

class IMURecord {
	public:	
		int accelX;
		int accelY;
		int accelZ;
		int pitch;
		int roll;
		int yaw;
		int heading;
};

class LogPage {
	public:
		GPSRecord GPS_data_sample;
		IMURecord IMU_data_sample[5];
};

class LogBuff {
	public:
		volatile uint8_t data[128];
};

class Log {


	public:
		unsigned long startTime;
	
		int IMU_record_idx;

		volatile LogPage workingPage;
		volatile LogPage page2Print;

		volatile LogPage *wPage;
		volatile LogPage *pPage;

		int address;
		
	
		void addGPS(long, long, int);
		void addIMU(int, int, int, int, int, int, int);
		//bool fullSample();

		void printPage(int);
		LogBuff PageToBuff(LogPage);
		LogPage BuffToPage(LogBuff);
};


#endif